package cn.com.pumpkin.aop;

import java.lang.reflect.Method;

/**
 * 
 * 连接点
 *     ...记录增强得两个信息,正则表示
 *         ...  信息1   类路径     
 *         ...  信息2   方法名  
 *
 */
public class PointCut {
	
	String classGateway;
	
	String methodGateway;
	
	public PointCut(String clazzGateway, String methodGateway){
		this.classGateway  = clazzGateway;
		this.methodGateway = methodGateway;
	}
	
	public boolean matchClassGateway(Class<?> clazz){
		return clazz.getName().matches(classGateway);
	}
	
	public boolean matchMethodGateway(Method method){
		return method.getName().matches(methodGateway);
	}
	
	
}
